-
-
Notifications
You must be signed in to change notification settings - Fork 8k
✨ Mount /backend/app/alembic/versions as a volume inside container during development
#1431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ Mount /backend/app/alembic/versions as a volume inside container during development
#1431
Conversation
/backend/app/alembic/versions as a volume inside container during development
This comment was marked as resolved.
This comment was marked as resolved.
|
As this PR has been waiting for the original user for a while but seems to be inactive, it's now going to be closed. But if there's anyone interested, feel free to create a new PR. |
This comment was marked as resolved.
This comment was marked as resolved.
YuriiMotov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Now changes made in backend/alembic/versions are visible inside the container.
Adding app/alembic/versions to ignore paths is needed to prevent infinite loop
| target: /app | ||
| ignore: | ||
| - ./backend/.venv | ||
| - app/alembic/versions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
./backend/.venv path was invalid - all paths in ignore are relative to path: ./backend. So, it expanded to ./backend/backend/.venv which does not exist.
I removed that invalid ./backend/.venv and added app/alembic/versions to prevent infinite loop on updating files in alembic/versions mounted volume
/backend/app/alembic/versions as a volume inside container during development/backend/app/alembic/versions as a volume inside container during development
|
This pull request has a merge conflict that needs to be resolved. |
|
Thanks for the interest! But as the user inside the container is different than the user outside, the generated files would belong to a different user ID, making them non-editable by the regular user (unless using It was like this at some point and I removed it to avoid this problem precisely. So I'll pass on this, but thanks! ☕ |
I've mapped the Docker container's Alembic folder to the local directory, ensuring that any auto-generated migration files created by Alembic are automatically copied to the local development environment.